package com.note.backend.mapper;

import com.note.backend.pojo.ChatHistory;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ChatHistoryMapper {


    @Insert("INSERT INTO chat_history (type, chat_id) VALUES (#{type}, #{chatId})")
    void insert(ChatHistory chatHistory);


    @Delete("DELETE FROM chat_history WHERE type = #{type} AND chat_id = #{chatId}")
    void delete(@Param("type") String type, @Param("chatId") String chatId);


    @Select("SELECT chat_id FROM chat_history WHERE type = #{type}")
    List<String> selectChatIdsByType(String type);

}